﻿using System.Collections.Generic;
using System.Text;

namespace ITProf.QuickMailer
{
    internal static class TypeExtensions
    {
        public static bool IsTrue(this bool? source)
        {
            return source != null && source.HasValue && source.Value;
        }

        public static string AsString(this IList<string> source)
        {
            if (source == null)
            {
                return "";
            }
            var sb = new StringBuilder();
            foreach (string str in source)
            {
                sb.AppendFormat("{0}; ", str);
            }
            return sb.ToString();
        }
    }
}